<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta content="zh-cn" http-equiv="Content-Language" />
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
		<meta name="renderer" content="webkit"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,  user-scalable=no"/>
		<title>{%$lngpack.sitename%}</title>
		<meta name="keywords" content="{%$lngpack.keyword%}" />
		<meta name="description" content="{%$lngpack.description%}" />
		<link rel="icon" type="image/png" href="{%$icon_16%}" sizes="16x16"/>
		<link rel="icon" type="image/png" href="{%$icon_32%}" sizes="32x32"/>
		<link rel="icon" type="image/png" href="{%$icon_64%}" sizes="64x64"/>
		<link href="{%$rootpath%}css/bootstrap.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcmsp8_font.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/swiper.min.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcmsp8_all.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcms_p8_public.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/jquery.min.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/bootstrap.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/swiper.min.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_base.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_dialog.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/citydb.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/cityselect.js"></script>
	</head>

	<body>
		{%link file="public/head.html"%}
		<section class="bann_container">
			<div class="container page_bann_title">
				<h2>Order</h2>
			</div>
		</section>

		<section class="container espcms_page_book">
			{%if $out=='order_list'%}
			<script type="text/javascript">
				$(window).load(function () {
					order_amount();
					order_del();
					$("#order_list").espcms_formvalidation({display_type: "top", display_icon_err: false});
				});
			</script>
			<div class="section-divider mb40"><span>Confirm ordering products or services</span></div>
			{% if count($array) > 0 %}
			<form name="order_list" method="post" id="order_list" class="form-horizontal admin-form" action="{%$order_link.settlement%}">
				<input type="hidden" name="product_total" id="product_total" value="{%$product_total%}"/>
				<input type="hidden" name="order_del_url" id="order_del_url" value="{%$order_link.del%}"/>
				<table class="table table-bordered tc">
					<thead class="contrast_th">
						<tr class="info">
							<th class="tc f16">Product or service</th>
							<th class="tc f16">Order price</th>
							<th class="tc f16">Quantity</th>
							<th class="tc f16">Subtotal</th>
							<th class="tc f16">Edit</th>
						</tr>
					</thead>
					<tbody class="contrast_td">
						{%forlist from=$array key=i%}
						<tr>
							<td class="tc">{%$array[i].title%}</td>
							<td class="tr">
								{%$array[i].bprice|espcms_format_money(3)%}
								<input type="hidden" name="bprice[]" value="{%$array[i].bprice%}"/>
								<input type="hidden" name="did[]" value="{%$array[i].did%}"/>
							</td>
							<td class="tc">
								<input type="text" name="amount[]" id="amount{%$array[i].did%}" value="{%$array[i].amount%}" data-id="{%$array[i].did%}" data-p="{%$array[i].bprice%}" size="2" maxlength="5" class="form-control amount" data-validation="^[1-9]{1}[\d]*$" placeholder="Please fill in the quantity" title="Please fill in the quantity" data-validation-msg="Sorry: the number is incorrectly entered."/>
							</td>
							<td class="tr">
								<span id="countprice_str_{%$array[i].did%}">{%$array[i].countprice|espcms_format_money(3)%}</span>
								<input type="hidden" class="countprice" name="countprice[]" id="countprice{%$array[i].did%}" value="{%$array[i].countprice%}">
							</td>
							<td class="tc"><button type="button" class="btn btn-orange delete_item" data-id="{%$array[i].did%}">Del</button></td>
						</tr>
						{%/forlist%}
						<tr>
							<td colspan="16" class="tr"><span class="text-orange">Total Amount:<span id="product_total_str">{%$product_total|espcms_format_money(3)%}</span></span></td>
						</tr>
						<tr>
							<td colspan="10" class="pt20 pb20">
								<div class="col-sm-6 p0 tl"><button class="btn btn-lightgray delete_all_item" type="button"/>Empty shopping cart</button></div>
								<div class="col-sm-6 p0 tr"><button class="btn btn-green" type="submit" formmethod="POST"/>Settlement</button></div>
							</td>
						</tr>
					</tbody>
				</table>
			</form>
			{%else%}
			<div class="tc">
				<h3>Sorry, you have not chosen to order the product!</h3>
			</div>
			{%/if%}
			{%elseif $out=='order_edit'%}
			<script type="text/javascript">
				$(function () {
					{% if $member_con.MEMBER_CITY_VERIFY == 1 %}
					$("#city_select").citySelect({
					prov: "{%if $member.province%}{%$member.province%}{%else%}北京{%/if%}",
						city: "{%$member.city%}",
						dist: "{%$member.district%}",
						nodata: "none"
					});
					{%/if%}
					$("#order_list").espcms_formvalidation({display_icon_err: false});
					//tab切换
					load_tabclick('.tab_click');
					conpon_check();
				});
			</script>
			<form name="order_list" method="post" id="order_list" class="form-horizontal admin-form" action="{%$order_link.save%}">
				<input type="hidden" name="tokenname" value="{%$tokenkey.token_name%}"/>
				<input type="hidden" name="tokenkey" value="{%$tokenkey.token_key%}"/>
				<input type="hidden" name="userid" id="userid" value="{%$member.userid%}"/>
				<input type="hidden" name="productmoney" id="productmoney" value="{%$product_total%}"/>
				<input type="hidden" name="isinvoice" id="isinvoice" value="0"/>
				<div class="section-divider mb40"><span>Fill in the order information</span></div>
				<div class="form-group">
					<div class="col-sm-12">
						<table class="table table-striped table-bordered tc">
							<thead class="contrast_th">
								<tr class="info">
									<th class="tc f16">Product or service</th>
									<th class="tc">Number</th>
									<th class="tc f16">Quantity</th>
									<th class="tc f16">Order price</th>
									<th class="tc f16">Subtotal</th>
								</tr>
							</thead>
							<tbody class="contrast_td">
								{%forlist from=$array key=i%}
								<tr>
									<td class="tc">
										<input type="hidden" name="product_item_price[]" value="{%$array[i].bprice%}"/>
										<input type="hidden" name="products_oprice[]" value="{%$array[i].oprice%}"/>
										<input type="hidden" name="products_id[]" class="products_id" data-tid="{%$array[i].tid%}" value="{%$array[i].did%}"/>
										<input type="hidden" name="products_tid[]" class="products_tid" value="{%$array[i].tid%}"/>
										<input type="hidden" name="products_name[]" value="{%$array[i].title%}"/>
										<input type="hidden" name="products_tsn[]" value="{%$array[i].tsn%}"/>
										<input type="hidden" name="istype[]" value="{%$array[i].type%}"/>
										{%$array[i].title%}
									</td>
									<td class="tc">{%$array[i].tsn%}</td>
									<td class="tc">{%$array[i].amount%}<input type="hidden" name="product_item_qty[]" id="amount_{%$array[i].did%}" value="{%$array[i].amount%}"></td>
									<td class="tr">
										{%$array[i].bprice|espcms_format_money(3)%}
									</td>
									<td class="tr">{%$array[i].countprice|espcms_format_money(3)%}<input type="hidden" name="product_item_total[]" id="countprice_{%$array[i].did%}" value="{%$array[i].countprice%}"></td>
								</tr>
								{%/forlist%}
								<tr>
									<td colspan="16" class="tr pb10">
										<span class="colorgreg">Total Amount:{%$product_total|espcms_format_money(3)%}<span class="discount_div displaynone"></span></span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>

				{%if $order_con.ORDER_ISOPID==1%}
				<div class="form-group">
					<label class="col-sm-2 control-label">Delivery Method</label>
					<div class="col-sm-9 pt6">
						{%forlist from=$shipplug key=i%}
						<input type="radio" name="osid" value="{%$shipplug[i].osid%}"{%if key=>i==1%} checked{%/if%} /> {%$shipplug[i].shippingname%}
							{%if $shipplug[i].price>0%}Freight:{%$shipplug[i].price%} {%/if%}{%$shipplug[i].content%}
							{%/forlist%}
					</div>
				</div>
				{%else%}
				<input type="hidden" name="osid" value="{%$order_con.ORDER_OPID%}"/>
				{%/if%}
				<input type="hidden" name="paytype" id="paytype" value="2"/>
				{%if $coupon_app.isetup && $coupon_app.isopen%}
				<input type="hidden" name="check_coupon_link" id="check_coupon_link" value="{%$check_coupon_link%}"/>
				<input type="hidden" name="discount" id="discount" value="0"/>
				<div class="form-group">
					<label class="col-sm-2 control-label">Coupon number</label>
					<div class="col-sm-9">
						<input type="text" name="ocdsn" id="ocdsn" class="form-control" data-isvalidation="true" data-validation="^[\w-]+$" placeholder="Please fill in the coupon number" title="Please fill in the coupon number" data-validation-msg="Sorry: The coupon number is incorrectly entered, please go back and re-enter!"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9">
						<a target="_blank" class="btn btn-success" href="{%$uncoupon_link%}">View coupons</a>
					</div>
				</div>
				{%/if%}

				<div class="form-group">
					<label class="col-sm-2 control-label">Consignee Name</label>
					<div class="col-sm-9"><input type="text" name="consignee" value="{%$member.alias%}" class="form-control" data-validation-minlength=" 4" data-validation-maxlength="50" placeholder="Please fill in the order consignee's real name" title="Please fill in the order consignee's real name" data-validation-msg="Sorry: the consignee's real name input Error, please go back and re-enter!"/></div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">E-mail</label>
					<div class="col-sm-9"><input type="text" name="email" value="{%$member.email%}" class="form-control" data-validation="^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$" Placeholder="Please enter E-mail" title="Please enter E-mail" data-validation-msg="Sorry: E-mail input error, please re-enter!"/></div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">Moblie</label>
					<div class="col-sm-9"><input type="text" name="mobile" value="{%$member.mobile%}" class="form-control" data-validation="^1[\d]{10}$" Placeholder="Please enter 11 mobile phone number" title="Please enter 11 mobile phone number" data-validation-msg="Sorry: the phone number is entered incorrectly, please re-enter!"/> </div>
				</div>
				{%if $member_con.MEMBER_CITY_VERIFY==1%}
				<div class="form-group">
					<label class="col-sm-2 control-label">Area</label>
					<div class="col-sm-9">
						<div id="city_select">
							<div class="col-sm-3 p0">
								<select class="form-control prov" name="province"></select>
							</div>
							<div class="col-sm-3 p0 pl5">
								<select class="form-control city" name="city" disabled="disabled"></select>
							</div>
							<div class="col-sm-3 pl5">
								<select class="form-control dist" name="district" disabled="disabled"></select>
							</div>
						</div>
					</div>
				</div>
				{%/if%}

				<div class="form-group">
					<label class="col-sm-2 control-label">Address</label>
					<div class="col-sm-9"><input type="text" name="address" value="{%$member.address%}" class="form-control" data-validation-minlength="4" data-validation-maxlength="200" Placeholder="Please fill in the order details" title="Please fill in the order details" data-validation-msg="Sorry: the order details address is entered incorrectly, please go back and re-enter!"/></div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">Remarks</label>
					<div class="col-sm-9">
						<textarea class="form-control" style="width:100%;height:120px" name="content" id="content" maxlength="800" data-isvalidation="true" data-validation-minlength="4" data-validation-maxlength="200" Placeholder="Please enter the order note, the length does not exceed 500 characters." title="Please enter the order note, the length does not exceed 500 characters." data-validation-msg="Sorry, the order comment input error, please enter Any character up to 500 characters in length!"></textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9">
						<button class="btn btn-orange" type="submit" formmethod="POST"/>Submit Order</button>
					</div>
				</div>
			</form>

			{%elseif $out=='edit_buyok'%}
			<div class="section-divider mb40"><span>Order Payment</span></div>
			<p class="bg-danger p10 tc">Please select the following payment method. If you encounter any problems during the payment process, please feel free to contact us! </p>
			<div class="tc">
				<h3> belongs to the order number: <span class="colorgreg b">{%$read.ordersn%}</span></h3>
				<h5 class="pt15">Orders: <span class="colorgreg">{%$read.orderamount|espcms_format_money(3)%}</span> (Total Product {%$read.productmoney|espcms_format_money(3) %}{%if $read.shippingmoney>0%} + Courier fee {%$read.shippingmoney|espcms_format_money(3)%}{%/if%}{%if $read.invoicefeemoney>0%} + Invoice Fee :{%$read.invoicefeemoney|espcms_format_money(3)%}{%/if%}{%if $read.discount>0%} - Offer {%$read.discount|espcms_format_money(3)%}{%/if %})</h5>
			</div>
			{%if $read.paytype==2 && count($pay_plug_list)>0%}
			<div class="tc mt30 mb30">
				{%forlist from=$pay_plug_list key=i%}
				<span class="pay_ico"><a href="{%$pay_plug_list[i].pay_link%}" title="{%$pay_plug_list[i].payname%}"><img src="{%$rootdir%}{%$pay_plug_list[i].paypic%}"/></a></span>
				{%/forlist%}
			</div>
			{%/if%}
			{%if $member_app.isetup && $member_app.isopen && $member.userid%}
			<div class="tc mt30 mb30">
				<a class="btn btn-success btn-shadow" href="{%$mlink.center%}">Member Center</a> <a class="btn btn-success btn-shadow ml5" href="{% $member_order_link%}">View Orders</a>
			</div>
			{%/if%}

			{%elseif $out=='pay_no'%}
			<div class="section-divider mb40"><span>Order Payment</span></div>
			<p class="bg-danger p10 tc">Please select the following payment method. If you encounter any problems during the payment process, please feel free to contact us! </p>
			<div class="tc">
				<h3> belongs to the order number: <span class="colorgreg b">{%$read.ordersn%}</span></h3>
				<h5 class="pt15">Orders: <span class="colorgreg">{%$read.orderamount|espcms_format_money(3)%}</span> (Total Product {%$read.productmoney|espcms_format_money(3) %}{%if $read.shippingmoney>0%} + Courier fee {%$read.shippingmoney|espcms_format_money(3)%}{%/if%}{%if $read.invoicefeemoney>0%} + Invoice Fee :{%$read.invoicefeemoney|espcms_format_money(3)%}{%/if%}{%if $read.discount>0%} - Offer {%$read.discount|espcms_format_money(3)%}{%/if %})</h5>
			</div>
			{%if $read.paytype==2 && count($pay_plug_list)>0%}
			<div class="tc mt30 mb30">
				{%forlist from=$pay_plug_list key=i%}
				<span class="pay_ico"><a href="{%$pay_plug_list[i].pay_link%}" title="{%$pay_plug_list[i].payname%}"><img src="{%$rootdir%}{%$pay_plug_list[i].paypic%}"/></a></span>
				{%/forlist%}
			</div>
			{%/if%}
			{%if $member_app.isetup && $member_app.isopen && $member.userid%}
			<div class="tc mt30 mb30">
				<a class="btn btn-success btn-shadow" href="{%$mlink.center%}">Member Center</a> <a class="btn btn-success btn-shadow ml5" href="{% $member_order_link%}">View Orders</a>
			</div>
			{%/if%}

			{%elseif $out=='pay_ok'%}
			<div class="section-divider mb40"><span>Payment success</span></div>
			<p class="bg-danger p10 tc">The following is your order payment information, if you have any questions, please feel free to contact me! </p>
			<div class="tc">
				<h3>Congratulations, the current order <span class="colorgreg b">{%$read.ordersn%}</span> has been paid successfully! </h3>
				<h4 class="pt15">The total amount paid is: {%$read.orderamount|espcms_format_money(3)%}</h4>
			</div>
			{%if $member_app.isetup && $member_app.isopen && $member.userid%}
			<div class="tc mt30 mb30">
				<a class="btn btn-success btn-shadow" href="{%$mlink.center%}">Member Center</a> <a class="btn btn-success btn-shadow ml5" href="{% $member_order_link%}">View Orders</a>
			</div>
			{%/if%}
			{%/if%}
		</section>

		{%link file="public/footer.html"%}
	</body>
</html>